// VBConversions Note: VB project level imports
using System.Diagnostics;
using System;
using System.Xml.Linq;
using System.Windows.Forms;
using System.Collections;
using System.Drawing;
using Microsoft.VisualBasic;
using System.Data;
using System.Collections.Generic;
using Microsoft.VisualBasic.Compatibility;
using System.Linq;
// End of VB project level imports

using System.Drawing.Drawing2D;


namespace 喷码数据生成工具
{
	sealed class Skin_Class
	{
		private static Color mBackBorderColor = Color.FromArgb(255, 152, 76, 220);
		private static Color mBackColor1 = Color.FromArgb(61, 116, 58);
		private static Color mBackColor2 = Color.FromArgb(24, 114, 26);
		private static Color mBackcolor3 = Color.FromArgb(61, 116, 58);
		public static Bitmap DrawFormButtonMode(int ImgWidth, int ImgHeight, sAPI.ENUMMOUSEEVENT nEvent)
		{
			if (ImgWidth <= 0 | ImgHeight <= 0)
			{
				return null;
			}
			Color _BackBorderColor = new Color();
			Color _BackColor1 = new Color();
			Color _BackColor2 = new Color();
			Color _BackColor3 = new Color();
			switch (nEvent)
			{
				case sAPI.ENUMMOUSEEVENT.MOUSENORMAL:
					_BackBorderColor = mBackBorderColor;
					_BackColor1 = mBackColor1;
					_BackColor2 = mBackColor2;
					_BackColor3 = mBackcolor3;
					break;
				case sAPI.ENUMMOUSEEVENT.MOUSEHOVER:
					break;
			}
			Bitmap img = new Bitmap(ImgWidth, ImgHeight);
			int L = 0;
			Graphics g = Graphics.FromImage(img);
			L = img.Height - 1;
			Rectangle TmpRect = new Rectangle(0, 0, L, L);
			g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
			GraphicsPath dPath = new GraphicsPath(FillMode.Alternate);
			LinearGradientBrush Bbrush = new LinearGradientBrush(new Rectangle(0, 0, img.Width, img.Height), _BackColor1, _BackColor2, LinearGradientMode.Vertical);
			ColorBlend ColorB = new ColorBlend();
			ColorB.Colors = new Color[] {_BackColor1, _BackColor2, _BackColor3};
			ColorB.Positions = new Single[] {0 / 2.0F, 1 / 2.0F, 3 / 3.0F};
			Bbrush.InterpolationColors = ColorB;
			dPath.AddArc(TmpRect, 90.0F, 180.0F);
			dPath.AddLine(new Point((int) ((double) L / 2), 0), new Point(img.Width - (double) L / 2 - 1, 0));
			TmpRect.X = img.Width - L - 1;
			dPath.AddArc(TmpRect, 270.0F, 180.0F);
			dPath.AddLine(new Point(img.Width - (double) L / 2 - 1, img.Height - 1), new Point((int) ((double) L / 2), img.Height - 1));
			g.FillPath(Bbrush, dPath);
			g.DrawPath(new Pen(_BackBorderColor), dPath);
			Bbrush.Dispose();
			dPath.Dispose();
			g.Dispose();
			return img;
			//  DrawBP(Me, img, 255)
		}
		public static object CreateRoundPath(Rectangle Rect, int R)
		{
			GraphicsPath ResultPath = new GraphicsPath(FillMode.Alternate);
			int L = 2 * R;
			Rectangle TmpRect = new Rectangle(Rect.Location, new Size(L, L));
			ResultPath.AddArc(TmpRect, 180.0F, 90.0F);
			ResultPath.AddLine(new Point(Rect.Left + R, Rect.Top), new Point(Rect.Right - R, Rect.Top));
			TmpRect.X = Rect.Right - L;
			ResultPath.AddArc(TmpRect, 270.0F, 90.0F);
			ResultPath.AddLine(new Point(Rect.Right, Rect.Top + R), new Point(Rect.Right, Rect.Bottom - R));
			TmpRect.Y = Rect.Bottom - L;
			ResultPath.AddArc(TmpRect, 0.0F, 90.0F);
			ResultPath.AddLine(new Point(Rect.Right - R, Rect.Bottom), new Point(Rect.Left + R, Rect.Bottom));
			TmpRect.X = Rect.Left;
			ResultPath.AddArc(TmpRect, 90.0F, 90.0F);
			ResultPath.AddLine(new Point(Rect.Left, Rect.Bottom - R), new Point(Rect.Left, Rect.Top + R));
			return ResultPath;
		}
	}
	
}
